package com.cy.listener;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

import com.cy.controller.MasterController;
import com.cy.controller.MusicController;

public class SwitchControlPanelListener extends MouseAdapter {

	@Override
	public void mouseClicked(MouseEvent e) {
		JLabel jl = (JLabel) e.getComponent();
		//开，左
		if(MasterController.switchControlPanel()) {
			jl.setIcon(new ImageIcon("image/left.png"));
		} else {//关，右
			jl.setIcon(new ImageIcon("image/right.png"));
		}
		//播放音乐
		MusicController.playSelect();
	}

}
